package com.i.template.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author lewis
 * @type class
 * @description
 * @since 2024/7/29
 */
@Component
public class RedisScheduleTask {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");

    @Scheduled(cron = "0 0 0 * * *")
    public void task() {
        //TODO: redis备份到mysql
        System.out.println("现在时间：" + dateFormat.format(new Date()));
    }
}

